class Animal:
    def speak(self):
        print("我是动物我会说话")

class People(Animal):
    def speak(self):
        print("say hello")

class Dog(Animal):
    def speak(self):
        print("汪汪汪")
    pass
class Pig(Animal):
    def speak(self):
        print("哼哼哼")
"""
if __name__ == '__main__':
    # p1 = People()
    # p1.speak()
    # pi1 = Pig()
    # pi1.speak()
    d1 = Dog()
    d1.speak()
"""
def speaks(obj):
    obj.speak()
p1 = Pig()
speaks(p1)
pe1 = People()
speaks(pe1)




